Tables [dbo].[ReceiptMain]
Properties
PropertyValue
Created10:31:36 AM Tuesday, March 02, 2010
Last Modified1:20:16 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Cluster Primary Key PK_ReceiptMain: ReceiptKeyForeign Keys FK_ReceiptMain_UniformRegistry: [dbo].[UniformRegistry].ReceiptKeyReceiptKeyuniqueidentifier16
No
Foreign Keys FK_Receipt_ReceiptTypeRef: [dbo].[ReceiptTypeRef].ReceiptTypeKeyIndexes IX_ReceiptMain_ReceiptTypeKey: ReceiptTypeKeyReceiptTypeKeyuniqueidentifier16
No
IsNumberAutoGeneratedbit1
No
Indexes AK_Receipt_ReceiptNumber: ReceiptNumberReceiptNumbernvarchar(50)100
No
IssuedOndatetime8
Yes
Notesnvarchar(200)400
Yes
Foreign Keys FK_ReceiptMain_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_ReceiptMain_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
Foreign Keys FK_Receipt_AccessMain: [dbo].[AccessMain].AccessKeyIndexes IX_ReceiptMain_AccessKey: AccessKeyAccessKeyuniqueidentifier16
No
Foreign Keys FK_ReceiptMain_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_ReceiptMain_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
Foreign Keys FK_Receipt_SystemEntity: [dbo].[SystemEntity].SystemEntityKeyIndexes IX_ReceiptMain_SystemEntityKey: SystemEntityKeySystemEntityKeyuniqueidentifier16
No
Foreign Keys FK_Receipt_ContactMain_IssuedTo: [dbo].[ContactMain].IssuedToContactKeyIndexes IX_ReceiptMain_IssuedToContactKey: IssuedToContactKeyIssuedToContactKeyuniqueidentifier16
No
MarkedForDeleteOndatetime8
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_ReceiptMain: ReceiptKeyPK_ReceiptMainReceiptKey
Yes
AK_Receipt_ReceiptNumberReceiptNumber
Yes
IX_ReceiptMain_AccessKeyAccessKey
IX_ReceiptMain_CreatedByUserKeyCreatedByUserKey
IX_ReceiptMain_IssuedToContactKeyIssuedToContactKey
IX_ReceiptMain_ReceiptTypeKeyReceiptTypeKey
IX_ReceiptMain_SystemEntityKeySystemEntityKey
IX_ReceiptMain_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_Receipt_AccessMainAccessKey->[dbo].[AccessMain].[AccessKey]
FK_Receipt_ContactMain_IssuedToIssuedToContactKey->[dbo].[ContactMain].[ContactKey]
FK_Receipt_ReceiptTypeRefReceiptTypeKey->[dbo].[ReceiptTypeRef].[ReceiptTypeKey]
FK_Receipt_SystemEntitySystemEntityKey->[dbo].[SystemEntity].[SystemEntityKey]
FK_ReceiptMain_UniformRegistryReceiptKey->[dbo].[UniformRegistry].[UniformKey]
FK_ReceiptMain_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_ReceiptMain_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
SQL Script
CREATE TABLE [dbo].[ReceiptMain]
(
[ReceiptKey] [uniqueidentifier] NOT NULL,
[ReceiptTypeKey] [uniqueidentifier] NOT NULL,
[IsNumberAutoGenerated] [bit] NOT NULL,
[ReceiptNumber] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IssuedOn] [datetime] NULL,
[Notes] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[AccessKey] [uniqueidentifier] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[SystemEntityKey] [uniqueidentifier] NOT NULL,
[IssuedToContactKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [PK_ReceiptMain] PRIMARY KEY CLUSTERED ([ReceiptKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [AK_Receipt_ReceiptNumber] UNIQUE NONCLUSTERED ([ReceiptNumber]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_AccessKey] ON [dbo].[ReceiptMain] ([AccessKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_CreatedByUserKey] ON [dbo].[ReceiptMain] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_IssuedToContactKey] ON [dbo].[ReceiptMain] ([IssuedToContactKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_ReceiptTypeKey] ON [dbo].[ReceiptMain] ([ReceiptTypeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_SystemEntityKey] ON [dbo].[ReceiptMain] ([SystemEntityKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReceiptMain_UpdatedByUserKey] ON [dbo].[ReceiptMain] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_Receipt_AccessMain] FOREIGN KEY ([AccessKey]) REFERENCES [dbo].[AccessMain] ([AccessKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_Receipt_ContactMain_IssuedTo] FOREIGN KEY ([IssuedToContactKey]) REFERENCES [dbo].[ContactMain] ([ContactKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_Receipt_ReceiptTypeRef] FOREIGN KEY ([ReceiptTypeKey]) REFERENCES [dbo].[ReceiptTypeRef] ([ReceiptTypeKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_Receipt_SystemEntity] FOREIGN KEY ([SystemEntityKey]) REFERENCES [dbo].[SystemEntity] ([SystemEntityKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_ReceiptMain_UniformRegistry] FOREIGN KEY ([ReceiptKey]) REFERENCES [dbo].[UniformRegistry] ([UniformKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_ReceiptMain_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[ReceiptMain] ADD CONSTRAINT [FK_ReceiptMain_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
Uses
Used By